# https://www.jianshu.com/p/8d1bdd7f4ff5
from peewee import *

# db = SqliteDatabase('people.db')
db = MySQLDatabase(charset='utf8', user='root', password='root', database="bool", host='localhost', port=3306)

class Person(Model):
    name = CharField()
    birthday = DateField()
    is_relative = BooleanField()

    class Meta:
        database = db

# 创建表
Person.create_table()

# 创建表也可以这样, 可以创建多个
# database.create_tables([Person])